<%-- 
    Document   : perso
    Created on : 9 mai 2010, 15:19:22
    Author     : coralie
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>VOD World</title>
        <link rel=stylesheet type="text/css" href="style.css">

        <jsp:useBean id="uttil" scope="request" class="ClassPackage.Utilisateur"/>
        <jsp:useBean id="film" scope="request" class="ClassPackage.Film"/>

        <%@page import="org.hibernate.SessionFactory" %>
        <%@page import="java.util.Set"%>
        <%@page import="java.util.Iterator"%>
        <%@page import="ClassPackage.Film"%>

        <% /*out.println("<h1>"+session.getAttribute("User_ID")+"</h1>");*/
        String test =(String)session.getAttribute("User_ID");
           out.println("<h1>"+test+"</h1>");
        uttil=uttil.getUser((SessionFactory)request.getAttribute("SessionFact"),Integer.parseInt(test));
%>
</head>
    <body>
        
        <div id="container">

            <%@ include file="header.jsp"%>

            <div id="main">
                <% if(session.getAttribute( "log" )!="" && session.getAttribute( "log" )!=null){         %>
                <div id="column_left">
                    <form id="client" class="cssform" action="">
                            <p><p><br>
                            <label id="login">Login : </label>
                            <%= session.getAttribute( "log" ) %>

                            <br>
                            <label for="nom">Nom : </label>
                            <%out.println(uttil.getName()); %>
                            <br>
                            <label for="prenom">Prénom : </label>
                            <%out.println(uttil.getLastname());%>
                            </p>
                            <p><p><br>
                             <label id="jeton">Nombre de jetons : </label>
                            <%out.println(uttil.getNbjetons());%>
                            <br>
                            <div style="margin-left: 150px;"><br>
                                <input type=button value="Acheter" onclick="location.replace('http://localhost:8080/VOD/jeton.jsp')" /><br>
                            </div>
                    </form>
                </div>

                <div id="column_right">
                   
                        <p><p><br>
                        <label for="filmAvoir">Film à regarder</label><br>
                        </p>
                        <div id="films" >
                            <form name="filmAvoir" action="">
                        <ol>
                            <% Set unSet = uttil.getFilm_a_voir();
                                Iterator it = unSet.iterator();
                                out.println("<h1>+ "+unSet.size()+" </h1>");
                                while(it.hasNext())
                                {
                                   film=(Film)it.next();
                                   %>
                                   <li><a id="titreFilm"href="/film.jsp"><% out.println(film.getTitre()); %></a<br></li>
                               <% }%>
                            
                        </ol>
                            </form>
                        </div>
                        <p><p><br>
                        <label for="filmVu">Film déjà vu</label><br>
                        </p>
                        <div id="films" >
                            <form name="filmAvoir" action="">
                        <ol>
                            <% unSet = uttil.getFilm_vu();
                                it = unSet.iterator();
                                while(it.hasNext())
                                {
                                   film=(Film)it.next();
                                   %>
                                   <li><a id="titreFilm"href="/film.jsp"><% out.println(film.getTitre()); %></a<br></li>
                               <% }%>
                        </ol>
                            </form>
                        </div>

                </div>
                <div class="spacer"/>
                <% }else{ %>
                    vous devez être logger
                <% } %>
            </div>

            <div id="footer">
                Site fait par Yves Derkac et Coralie Vessières
            </div>

        </div>

    </body>
</html>
